package com.healthcloud.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.healthcloud.entity.MedicationGuid;
import com.healthcloud.service.MedicationGuidService;
import com.healthcloud.utils.ApiRes;
import springfox.documentation.annotations.ApiIgnore;

/**
 * 健康教育 用药指导
 * Created by XYC on 2015/9/16.
 * Updated by houxianghua on 2016/5/10.
 */
@ApiIgnore
@Api(value = "示例说明", description = "健康教育 用药指导")
@RestController
@RequestMapping(value = "/app/dean/healthEducation/medicationGuid")
public class MedicationGuidApiController {

    @Autowired
    private MedicationGuidService medicationGuidService;

	@ApiOperation(value = "",notes ="")
    @RequestMapping(value = "/allName",method = RequestMethod.POST)
    public Object getAllHealthEducationNameData(MedicationGuid medicationGuid){
        ApiRes apiRes = new ApiRes(medicationGuidService.findAllMedicaName());
        return apiRes;
    }

	@ApiOperation(value = "上传体检信息",notes ="上传体检信息")
    @RequestMapping(value = "/medicalInfo",method = RequestMethod.POST)
    public Object getHealthEdcationOneRowData(MedicationGuid medicationGuid){
        MedicationGuid medicationGuidTemp= medicationGuidService.findByFid(medicationGuid);
        ApiRes apiRes = new ApiRes(medicationGuidTemp);
        if(medicationGuidTemp==null){
            apiRes.setSuccess(false);
        }
        return apiRes;
    }

	@ApiOperation(value = "",notes ="")
    @RequestMapping(value = "/getFoodGuidance",method = RequestMethod.POST)
    public Object getFoodGuidance(MedicationGuid medicationGuid){
        MedicationGuid medicationGuidTemp= medicationGuidService.findByFid(medicationGuid);
        ApiRes apiRes = new ApiRes(medicationGuidTemp);
        if(medicationGuidTemp==null){
            apiRes.setSuccess(false);
        }
        return apiRes;
    }
}
